#include <sstream>
#include <boost/algorithm/string.hpp>
#include <xscript/xitemlist.h>
#include <xscript/xitemstring.h>
#include <xscript/xitemvisitor.h>

std::shared_ptr<XItemString> XItemString::createXItemString(const std::wstring& string, uint32_t count) {
    std::wstringstream stream;
    for (uint32_t i = 0; i < count; i++)
        stream << string;
    return std::make_shared<XItemString>(stream.str());
}

std::wstring XItemString::getItemInfo() {
    return value;
}

void XItemString::accept(std::shared_ptr<XItemVisitor> visitor) {
    if (visitor)
        visitor->visit(asString());
}
